﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ConsoleApplication
{
     public class ArticleDAO: BaseDAO
    {/*
        private int idMySql;
        public int idOracle;
        public string reference { get; set; }
        //public string designation;            // A mettre plutot dans le DTO vu que ce n'est pas dans la base
        public int idUniteReference { get; set; }            //unité de référence de l'article

        public ArticleDAO(int idArt)
        {
            using (newStoreContext = new newstoreEntitiesConsole())
            {
                try
                {
                    var query = from article in newStoreContext.articles
                                where article.id_article == idArt
                                select article;

                    if (query.LongCount() == 0)
                        throw new Exception("Aucun article avec cet id !!");

                    foreach (var art in query)
                    {
                        this.idMySql = art.id_article;
                        this.idOracle = art.id_article_oracle;
                        this.idUniteReference = art.id_unite;
                        this.reference = art.ref_article;
                        this.designation = string.Empty;
                        Console.WriteLine("ArticleDAO instancié !!");
                    }
                    
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                finally
                {
                    Console.ReadLine();
                }
               
            }
            
        }

         */
    }
}